<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Role extends Model
{
    public function getUser()
    {
        return $this->belongsToMany('App\Models\User', 'role_user', 'role_id', 'user_id');
    }

    public function getEntity()
    {
        return $this->belongsToMany('App\Models\Entity', 'role_access_privilege', 'role_id', 'entity_id');
    }

    public function getPrivilegeValue()
    {
        return $this->belongsToMany('App\Models\Privilege', 'role_access_privilege', 'role_id', 'privilege_value');
    }
}
